vcScope

A container for statements.

See in: Overview

Module: vcExecutor2

Parent: -

Children -

Referenced by: vcIfStatement.ElseScope, vcIfStatement.ThenScope, vcMultiScopeContainer.Scopes, vcMultiScopeContainer.copyScope(), ... (see more)
vcIfStatement.ElseScope
vcIfStatement.ThenScope
vcMultiScopeContainer.Scopes
vcMultiScopeContainer.copyScope()
vcMultiScopeContainer.createScope()
vcRoutine.Scope
vcSingleScopeContainer.Scope
vcStatement.ParentScope

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
NameStringRWGets or sets the name for the scope.
ParentvcObjectRvcExecutor2.vcRoutine | vcExecutor2.vcStatement: Gets the parent of the scope.

Exceptions:
RuntimeError: When internal error occurs because of orphan scope."
RoutinevcRoutineRGets the owner routine.
StatementsvcList[vcStatement]Rlist[vcExecutor2.vcStatement]: Gets the contained statements.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
clearStatementsNoneNoneDeletes every statement in the scope.

Parameters:
None

Returns:
None
copyStatementvcStatementvcStatement statement,
Integer index
Clones the statement within or into this scope.
See more
Parameters:
statement (vcExecutor2.vcStatement): A statement to clone.
index (int): Index to insert the statement to. Must be zero or positive.
If index is greater than the number of contained statements, the cloned statement is added to the end.

Returns:
vcExecutor2.vcStatement: The copied instance.

Exceptions:
RuntimeError: When copying fails due to incompatible statement.
createStatementvcStatementString type,
Optional Keyword[index = Integer]
Creates and adds a new statement into the scope.
See more
Parameters:
type (str): Type name of the statement.
Optional: index (int): Index to add the statement to. Must be zero or positive.
If index not given or is greater than the number of contained statements, the statement is added to the end.

Returns:
vcExecutor2.vcStatement: The new statement.

Exceptions:
ValueError: When the type name is invalid or creation fails.
deleteNoneNone"
Deletes the scope. Only certain scopes can be deleted.
See more
Parameters:
None

Returns:
None

Exceptions:
TypeError: When scope cannot be deleted.
moveStatementNonevcStatement statement,
Integer index
Relocates the statement within or into this scope.
See more
Parameters:
statement (vcExecutor2.vcStatement): A statement to move
index (int): Index to move the statement to. Must be zero or positive.
If index is greater than the number of contained statements, the statement is moved to the end.

Returns:
None

Exceptions:
RuntimeError: When move fails due to incompatible statement.

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnStatementAddedvcStatement statementInvoked when a statement is added to the scope.

Parameters:
statement (vcExecutor2.vcStatement): The newly added statement.
OnStatementRemovingvcStatement statementInvoked when a statement is about to be removed from the scope.
See more
Parameters:
statement (vcExecutor2.vcStatement): The statement about to be removed.